package com.hobee.basic.config.datasource;

/**
 * @author junjie.li
 * @date 2020/6/29 18:19
 */
public class DataSourceContextHolder {

    private final static ThreadLocal<String> THREAD_LOCAL = new ThreadLocal<>();

    public static void putDataSource(String name) {
        THREAD_LOCAL.set(name);
    }

    public static String getCurrentDataSource() {
        return THREAD_LOCAL.get();
    }

    public static void removeCurrentDataSource() {
        THREAD_LOCAL.remove();
    }
}
